<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id')->comment('文章表');
            $table->string('article_title', 255)->nullable()->comment('文章标题');
            $table->longText('content')->nullable()->comment('文章内容');
            $table->string('list_img', 255)->nullable()->comment('列表图片');
            $table->text('imgs')->nullable()->comment('多图');
            $table->string('video_url', 255)->nullable()->comment('视频地址');
            $table->integer('region_id')->nullable()->comment('所属地区ID（1.北洸村）')->default(0);
            $table->integer('read_num')->nullable()->comment('阅读次数')->default(0);
            $table->integer('zan_num')->nullable()->comment('点赞次数')->default(0);
            $table->integer('collect_num')->nullable()->comment('收藏次数')->default(0);
            $table->integer('like_num')->nullable()->comment('喜欢次数')->default(0);
            $table->integer('share_num')->nullable()->comment('分享次数')->default(0);
            $table->integer('category_id')->nullable()->comment('分类ID')->default(0);
            $table->tinyInteger('is_top')->nullable()->comment('置顶')->default(0);
            $table->integer('weight')->nullable()->comment('权重')->default(0);
            $table->integer('user_id')->nullable()->comment('用户作者ID')->default(0);
            $table->integer('admin_id')->nullable()->comment('管理员作者ID')->default(0);
            $table->tinyInteger('is_admin')->nullable()->comment('是否为管理员发布')->default(0);
            $table->tinyInteger('types')->nullable()->comment('文章类型（1图文，2视频）')->default(0);
            $table->tinyInteger('is_show')->nullable()->comment('展示状态1展示；0隐藏')->default(1);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
